const Actions = require('./actions');
const DB = require('app/db.js');

module.exports = Reflux.createStore({
    listenables: [Actions],
    data: {
    
    },

    onFetchDetail: function (params, cb) {
        let t = this;
        DB.Parent.get_Evalute_detail({
            schoolId: params.schoolId,
            evaluateId: params.evaluateId
        })
            .then((content) => {
                let schoolId = content.check.schoolId;
                let evaluateId = content.check.evaluateId;
                content = content.data;
                this.data["urlList"]= content.urlList;
                this.data["selEvaluateRank"]= content.selEvaluateRank;
                this.data["evaluateTitle"]= content.evaluateTitle;
                this.data["evaluateId"]=content.evaluateId;
                this.data["createDate"]=content.createDate;
                this.data["teacherName"]=content.teacherName;
                this.data["msg"]=content.msg;
                t.updateComponent();
            })
            .catch(function (error) {

            });
    },

    updateComponent: function () {
        this.trigger(this.data);
    }
});
